Title: Year 12 / Computer Science / Practical / 10 - Data types and structures / 10.3 - Files

Q: Explain why files are needed
A: to import contents from a file saved in secondary memory into the program or to save output of a program in a file into secondary memory so its available for future use

Q: State the 3 different modes for opening a file
A: read, write, append

Q: Write the psuedocode for opening a file
A: OPENFILE <filename> FOR <openmode>

Q: Write the psuedocode for reading a file
A: READFILE <filename>, <variable>

Q: Write the psuedocode for writing a line of text to the file
A: WRITEFILE <filename>, <string>

Q: Write the psuedocode for closing a file
A: CLOSEFILE <filename>

Q: Write the psuedocode for testing for the end of the file
A: EOF(<filename>)